package cn.tedu.spring.eg1;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class Product {
    /*
    简单类型的注入
    可以在属性和set方法上使用
     */
    @Value("爱疯18")
    private String title;
    @Value("798")
    private Integer num;
    @Value("果子大家用，我把钱钱赚")
    private String comment;
    @Value("肾机")
    public void setTitle(String title) {
        this.title = title;
    }

    @Override
    public String toString() {
        return "Product{" +
                "title='" + title + '\'' +
                ", num=" + num +
                ", comment='" + comment + '\'' +
                '}';
    }
}
